﻿@model FlyingCircusWebIS.ViewModels.CupomVM.CupomFormVM

@section css{
    @Styles.Render("~/Content/css/formulario")
}

<div id="outraspg">
    @{
        if (Model.Edicao)
        {
            ViewBag.Title = "Editar Cupom";
        <h1>Edite os dados do cupom</h1>
        }
        else
        {
            ViewBag.Title = "Cadastrar Cupom";
        <h1>Informe os dados do cupom</h1>
        }
    }

    @using (Html.BeginForm("Form", "Cupom", FormMethod.Post))
    {  
        @Html.ValidationSummary(true)
        <div class="conteudodivs">
            <dl>

                @Html.HiddenFor(model => model.Edicao)
                <dd>
                    @Html.LabelFor(model => model.NomeCupom)
                    @Html.TextBoxFor(model => model.NomeCupom)<br />
                    @Html.ValidationMessageFor(model => model.NomeCupom)
                </dd>
                <dd>
                    @Html.LabelFor(model => model.Descricao)
                    @Html.TextAreaFor(model => model.Descricao)
                    @Html.ValidationMessageFor(model => model.Descricao)

                </dd>
                <dd>
                    @Html.LabelFor(model => model.Desconto)
                    @Html.TextBoxFor(model => model.Desconto, new { id = "txtValorDescPorc" })
                    @Html.ValidationMessageFor(model => model.Desconto)

                </dd>
                <dd>
                    <br />
                    @Html.CheckBoxFor(model => model.FlagAtivo)
                    @Html.LabelFor(model => model.FlagAtivo, new { @style = "display:inline; margin-left:2px" })
                </dd>
                @Html.LabelFor(model => model.CodCupom)
                <dd>
                    @if (Model.Edicao)
                    {
                        @Html.TextBoxFor(model => model.CodCupom, new { @readonly = "readonly" })
                    }
                    else
                    {
                        @Html.TextBoxFor(model => model.CodCupom)<br />
                        @Html.ValidationMessageFor(model => model.CodCupom)
                    }
                </dd>
            </dl>
        </div>
        <div class="espacodasinfos">
            <input class="enviar" type="submit" value="Salvar" />
        </div>
    }

    <div class="voltar">
        @Html.ActionLink("Voltar", "Index")
    </div>

</div>


@section scripts 
{
    <script type="text/javascript">

        $(document).ready(function () {
            ConfiguraMascaras();
        });

        function ConfiguraMascaras() {
            $("#txtValorDescPorc").mask("##0,99", { reverse: true });

        }

        $(document).ready(function () {
            $(".gerenciar").toggleClass("current");
        });
    </script>
}